<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="/templates/_template.xhtml">

        <ui:define name="titulo">

            <h3>Cadastro de Taxas</h3>

        </ui:define>

        <ui:define name="conteudo">

            <p:growl autoUpdate="true" />
            <h:form>
                <p:messages id="messages" autoUpdate="true" />

                <h:inputHidden id="codigo" value="#{usuarioBean.usuario.codigo}"/>

                <p:fieldset legend="Dados da Taxa" styleClass="fieldsetSms">

                    <h:panelGrid columns="2">
                        <h:outputLabel value="Taxa:"  for="nome" styleClass="rotulos"/>                                
                        <p:inputText id="nome" value="#{usuarioBean.usuario.nome}"
                                     required="true"
                                     requiredMessage="Taxa, campo obrigatório."
                                     validatorMessage="a taxa só pode conter números" 
                                     maxlength="50" size="10" >
                            <f:validateLength maximum="50" />
                            <f:ajax event="blur" render="messages" />
                        </p:inputText>
                    <h:outputLabel value="Tipo Taxa:"  for="pagar-receber" styleClass="rotulos"/>                                
                    <p:selectOneRadio id="pagar-receber" value="1"  
                                      styleClass="rotulos">  
                        <f:selectItem itemLabel="Contas a Pagar" itemValue="1" />  
                        <f:selectItem itemLabel="Contas a Receber" itemValue="2" />  
                      
                    </p:selectOneRadio> 
                       

                    </h:panelGrid>
                    <br />
                    <p:commandButton value="Salvar" action="#{usuarioBean.salvar()}"/>
                    <p:commandButton value="Consultar" action="#{usuarioBean.consultar()}" immediate="true"/>
                    <p:commandButton value="Cancelar" action="#{smsBean.formPrincipal()}" immediate="true" />

                </p:fieldset>

            </h:form>
        </ui:define>
    </ui:composition>

</html>